home *** CD-ROM | disk | FTP | other *** search
/ CSi Master: Pro Tools 6 / CSi Master: Pro Tools 6.iso / mac / QuickTime Installer-0SX / QuickTime.pkg / Contents / Resources / postflight < prev    next >
Encoding:
Text File  |  2003-07-07  |  1.6 KB  |  64 lines

  1. #!/usr/bin/perl
  2.  
  3. my $runnerPID = getppid();
  4. my $installerPID = "";
  5. my $uid = "";
  6. my $uname = "";
  7.  
  8. open( PSOUT, "/bin/ps -axww -o pid,ppid -p $runnerPID |" );
  9. while( <PSOUT> ) {
  10.     my @fields = split '\s+', $_;
  11.     if ("$fields[1]" eq "$runnerPID") {
  12.         $installerPID = $fields[2];
  13.     }
  14. }
  15. close( PSOUT );
  16.  
  17. if ("$installerPID" ne "") {
  18.     open( PSOUT, "/bin/ps -axww -o pid,ruid -p $installerPID |" );
  19.     while( <PSOUT> ) {
  20.         my @fields = split '\s+', $_;
  21.         if ("$fields[1]" eq "$installerPID") {
  22.             $uid = $fields[2];
  23.         }
  24.     }
  25.     close( PSOUT );
  26. }
  27.  
  28. if ("$uid" ne "") {
  29.     open( PSOUTA, "/usr/bin/id -p $uid |" );
  30.     while( <PSOUTA> ) {
  31.         my @fields = split '\s+', $_;
  32.         if ("$fields[0]" eq "uid") {
  33.             $uname = $fields[1];
  34.         }
  35.     }
  36.     close( PSOUTA );
  37. }
  38.  
  39. ###################################################################
  40.  
  41. # Remove old unneeded quicktime pieces
  42. my $CLEANUP_SCRIPT = "$ARGV[0]" . "/Contents/Resources/cleancruft";
  43. $cmd = "\"$CLEANUP_SCRIPT\" \"$ARGV[0]\" \"$ARGV[1]\" \"$ARGV[2]\" \"$ARGV[3]\"";
  44. system( "$cmd" );
  45.  
  46. ########
  47.     
  48. # Stuff the installation info into the preferences for QT Updates
  49. my $INSTALL_INFO= "$ARGV[0]" . "/Contents/Resources/installinfo";
  50. my $cmd = "\"$INSTALL_INFO\" -postinstall -volume \"$ARGV[2]\" -type full";
  51. #print STDOUT "INSTALL_INFO: $cmd\n";
  52. system("$cmd");
  53.  
  54. ########
  55.  
  56. # Configure the browser mime types based on the installed QuickTime
  57. my $CONFIGURE_MIME_TYPES= "$ARGV[0]" . "/Contents/Resources/ConfigureMimeTypes";
  58. my $cmd = "\"$CONFIGURE_MIME_TYPES\" -rescan -verbose";
  59. if ("$uname" ne "") {
  60.     $cmd = "sudo -u $uname \"$CONFIGURE_MIME_TYPES\" -rescan -verbose";
  61. }
  62. #print STDOUT "CONFIGURE_MIME_TYPES: $cmd\n";
  63. system("$cmd");
  64.